import { postRequest, getRequest, deleteRequest, postRequest3 } from '@/utils/api'

const $userManageApi = {
    // 新增用户
    addUser: param => {
        return postRequest('/gv-kube/user/add', param)
    },
    // 获取角色（分页）
    pageGetRole: param => {
        return getRequest('/gv-kube/role/get/all/page', param)
    },
    // 获取角色（全部）
    getAllRole: () => {
      return postRequest('/gv-kube/role/get/all')
    }, 
    // 分页获取用户信息
    pageGetUserInfo: param => {
        return postRequest('/gv-kube/user/get/page', param)
    },
    // 删除用户
    deleteUser: param => {
        return postRequest('/gv-kube/user/delete', param)
    },
    // 编辑更新用户
    updateUser: param => {
        return postRequest('/gv-kube/user/update/info', param)
    },
    // 更新用户状态
    updateUserStatus: (param,body) => {
        return postRequest3('/gv-kube/user/update/status', param, body)
    },
    //获取用户信息
    getUserInfo : (id) => {
        return getRequest('/gv-kube/user/get/info',id)
    },
    //修改用户密码
    editUserPassword : (param) => {
        return postRequest(`/gv-kube/user/update/password?id=${param.id}&originalPassword=${param.originalPassword}&newPassword=${param.newPassword}`)
    }
}

export default $userManageApi
